require 'monster_type'

def monster_type
	types = []
	id = 1;
	MONSTER_TYPE.each do |type|
		types << "MonsterType::sTypes.push_back(MonsterType(#{id}, _T(\"#{type[:chiness_name]}\")));"
		id += 1
	end
	types.join("\n\t\t\t\t")
end

File.open('templates/monster_type_template', 'r') do |read_file|
	write_file = File.new('out/MonsterType.cpp', 'w')
	while line = read_file.gets
		line.gsub!(/\$\(monster_type\)/, monster_type)
		write_file.puts(line)
	end
	write_file.close()
end
